<template>
  <div class="wrapper">
    <el-row>
      <el-col :span="24">
        <div class="header">
          <span class="welcome">
            <font size="4" face="宋体">
              <strong
                >{{ userInfo.realname }}：您好！欢迎进入项目中期考核</strong
              >
            </font>
          </span>
          <!-- <el-button
            size="mini"
            round
            style="background-image: linear-gradient(#e9f0e9, white);float:right; margin: 2px 50px 0 0;"
            @click="back()"
            >返 回</el-button
          > -->
        </div>
      </el-col>
    </el-row>
    <div class="formall">
      <el-row>
        <el-col :span="24">
          <div class="title">
            <font size="4.7" face="微软雅黑">
              <strong>基本信息表</strong>
            </font>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <div class="form_demo">
          <el-form ref="form" :model="form" label-width="100px">
            <el-col :span="6">
              <el-form-item label="批准号" prop="pro_no">
                <el-input
                  v-model="form.pro_no"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="计划完成时间" prop="finish_time">
                <el-date-picker
                  v-model="form.finish_time"
                  type="date"
                  :disabled="true"
                  class="form_demo_input"
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期"
                >
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="项 目 名 称" prop="title">
                <el-input
                  v-model="form.title"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="主 要 负 责 人" prop="name">
                <el-input
                  v-model="form.name"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="联 系 电 话" prop="office">
                <el-input
                  v-model="form.office"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="手机" prop="phone">
                <el-input
                  v-model="form.phone"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="责 任 单 位" prop="unit">
                <el-input
                  v-model="form.unit"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="通 讯 地 址 " prop="postal_address">
                <el-input
                  v-model="form.postal_address"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="邮 政 编 码 " prop="post_code">
                <el-input
                  v-model="form.post_code"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="6">
              <el-form-item label="email " prop="email">
                <el-input
                  v-model="form.email"
                  :disabled="true"
                  class="form_demo_input"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-form>
        </div>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="title">
            <font size="4.7" face="微软雅黑">
              <strong>研究进展情况</strong>
            </font>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <div class="form_demo">
          <el-form ref="Process_form" :model="Process_form" label-width="80px">
            <el-form-item prop="research_progress">
              <el-input
                type="textarea"
                :rows="5"
                placeholder="主要内容：1.研究计划总体执行情况及各子课题进展情况；
           2.调查研究及学术交流情况（调研数据整理运用、文献资料收集整理、学术会议、学术交流、国际合作等）；
           3.成果宣传推介情况（成果发布会、《工作简报》报送情况、国家社科基金专刊投稿及采用情况等）
           4.研究中存在的主要问题、改进措施，研究心得、意见建议；
           5.其他需要说明的问题。 "
                v-model="Process_form.research_progress"
              >
              </el-input>
            </el-form-item>
          </el-form>
        </div>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="title">
            <font size="4.7" face="微软雅黑">
              <strong>研究成果情况</strong>
            </font>
            <el-button icon="el-icon-plus" @click="showedit()"></el-button>
          </div>
        </el-col>
        <div>
          <el-dialog
            title="研究成果"
            center
            :visible.sync="dialogVisible"
            width="30%"
            :before-close="handleClose"
          >
            <el-form
              ref="achievement_form"
              :model="achievement_form"
              label-width="100px"
            >
              <el-form-item label="名 称">
                <el-input
                  v-model="achievement_form.achievement_name"
                  class="dialog_demo"
                ></el-input>
              </el-form-item>
              <el-form-item label="作者">
                <el-input
                  v-model="achievement_form.achievement_author"
                  class="dialog_demo"
                ></el-input>
              </el-form-item>
              <el-form-item label="成果形式">
                <el-input
                  v-model="achievement_form.achievement_type"
                  class="dialog_demo"
                ></el-input>
              </el-form-item>
              <el-form-item label="刊物名或出版社">
                <el-input
                  v-model="achievement_form.achievement_publish"
                  class="dialog_demo"
                ></el-input>
              </el-form-item>
              <el-form-item label="出版时间">
                <el-date-picker
                  v-model="achievement_form.achievement_publish_time"
                  type="date"
                  class="dialog_demo"
                  value-format="yyyy-MM-dd"
                >
                </el-date-picker>
              </el-form-item>
              <el-form-item label="字数(万)">
                <el-input
                  class="dialog_demo"
                  v-model="achievement_form.achievement_number"
                ></el-input>
              </el-form-item>
              <el-form-item label="获奖或转摘引用情况">
                <el-input
                  v-model="achievement_form.achievement"
                  type="textarea"
                  class="dialog_demo"
                  :rows="3"
                ></el-input>
              </el-form-item>
            </el-form>
            <span slot="footer" class="dialog-footer">
              <el-button
                type="primary"
                @click="submitachievement_form(achievement_form)"
                >确定</el-button
              >
              <el-button @click="dialogVisible = false">取 消</el-button>
            </span>
          </el-dialog>
        </div>
      </el-row>
      <el-row>
        <div class="table_demo">
          <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="achievement_name" label="名 称" width="180">
            </el-table-column>
            <el-table-column prop="achievement_author" label="作者" width="180">
            </el-table-column>
            <el-table-column prop="achievement_type" label="成果形式">
            </el-table-column>
            <el-table-column prop="achievement_publish" label="刊物名或出版社">
            </el-table-column>
            <el-table-column prop="achievement_publish_time" label="出版时间">
            </el-table-column>
            <el-table-column prop="achievement_number" label="字数(万)">
            </el-table-column>
            <el-table-column prop="achievement" label="获奖或转摘引用情况">
            </el-table-column>
            <el-table-column label="操作">
              <template slot-scope="scope">
                <el-button
                  @click="handleClick(scope.row)"
                  type="primary"
                  size="small"
                  >编辑</el-button
                >
                <el-button
                  type="danger"
                  size="small"
                  @click="handleDelete(scope.row)"
                  >删除</el-button
                >
              </template>
            </el-table-column>
          </el-table>
        </div>
      </el-row>
      <el-row>
        <el-col :span="24">
          <div class="title">
            <font size="4.7" face="微软雅黑">
              <strong>下一步研究计划和经费预算</strong>
            </font>
          </div>
        </el-col>
      </el-row>
      <el-row>
        <el-form :model="plan_form" label-width="150px">
          <el-row>
            <el-col :span="4">
              <div class="form_item">
                <el-form-item>
                  <span>本项目首次资助经费金额</span>
                  <el-input v-model="funds"></el-input>
                </el-form-item>
              </div>
            </el-col>
          </el-row>
          <el-form-item>
            <article>
              已拨付经费开支情况（请如实填写以下细目，同时提交由责任单位财务管理部门出具并盖章的经费开支明细账）
            </article>
          </el-form-item>
          <el-row>
            <el-col :span="4">
              <el-form-item label="资料费">
                <el-input v-model="plan_form.book_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="数据采集费" prop="data_fee">
                <el-input v-model="plan_form.data_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="差旅费" prop="travel_fee">
                <el-input v-model="plan_form.travel_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="会议费" prop="meeting_fee">
                <el-input v-model="plan_form.meeting_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="国际合作与交流费" prop="international_fee">
                <el-input v-model="plan_form.international_fee"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4">
              <el-form-item label="设备费" prop="equipment_fee">
                <el-input v-model="plan_form.equipment_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="专家咨询费" prop="consulting_fee">
                <el-input v-model="plan_form.consulting_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="劳务费" prop="labour_fee">
                <el-input v-model="plan_form.labour_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="印刷费" prop="print_fee">
                <el-input v-model="plan_form.print_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="管理费" prop="administration_fee">
                <el-input v-model="plan_form.administration_fee"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="line"></div>
          <el-row>
            <el-col :span="4">
              <el-form-item label="其他" prop="other_fee">
                <el-input v-model="plan_form.other_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="总计" prop="all_fee">
                <el-input v-model="plan_form.all_fee"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="结余" prop="surplus">
                <el-input v-model="plan_form.surplus"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-form-item>
              <article prop="未支出经费预算(要分项列出开支明细)"></article>
            </el-form-item>
          </el-row>
          <el-row>
            <el-col :span="4">
              <el-form-item label="资料费" prop="book_fee_budget">
                <el-input v-model="plan_form.book_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="数据采集费" prop="data_fee_budget">
                <el-input v-model="plan_form.data_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="差旅费" prop="travel_fee_budget">
                <el-input v-model="plan_form.travel_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="会议费" prop="meeting_fee_budget">
                <el-input v-model="plan_form.meeting_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item
                label="国际合作与交流费"
                prop="international_fee_budget"
              >
                <el-input
                  v-model="plan_form.international_fee_budget"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="4">
              <el-form-item label="设备费" prop="equipment_fee_budget">
                <el-input v-model="plan_form.equipment_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="专家咨询费" prop="consulting_fee_budget">
                <el-input v-model="plan_form.consulting_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="劳务费" prop="labour_fee_budget">
                <el-input v-model="plan_form.labour_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="印刷费" prop="print_fee_budget">
                <el-input v-model="plan_form.print_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="管理费" prop="administration_fee_budget">
                <el-input
                  v-model="plan_form.administration_fee_budget"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <div class="line"></div>
          <el-row>
            <el-col :span="4">
              <el-form-item label="其他" prop="other_fee_budget">
                <el-input v-model="plan_form.other_fee_budget"></el-input>
              </el-form-item>
            </el-col>
            <el-col :span="4">
              <el-form-item label="总计" prop="all_fee_budget">
                <el-input v-model="plan_form.all_fee_budget"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="下一步研究计划" prop="next_plan">
                <el-input
                  type="textarea"
                  :row="6"
                  v-model="next_plan"
                  placeholder="要列出具体工作方案"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row>
            <el-col :span="12">
              <el-form-item label="经费缺口情况" prop="funding_gap">
                <el-input
                  type="textarea"
                  :row="6"
                  v-model="funding_gap"
                  placeholder="研究规模大、周期长、分量重，经费确实存在较大缺口的课题组可填写此项"
                ></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
      </el-row>
      <div class="button_demo">
        <el-button type="primary" @click="goback()">返回</el-button>
        <el-button type="primary" @click="submitform()">提交</el-button>
        <!-- <el-button @click="down()" :disabled="this.status == 1">查看</el-button> -->
      </div>
    </div>
  </div>
</template>

<script>
import http from './../../../../assets/js/http.js'
export default {
  data() {
    return {
      funds: '',
      next_plan: '',
      funding_gap: '',
      userInfo: Lockr.get('userInfo'),
      dialogVisible: false,
      form: {
        project_mid_id: '',
        pro_no: '',
        finish_time: '',
        title: '',
        name: '',
        office: '',
        phone: '',
        unit: '',
        postal_address: '',
        email: '',
        filling_date: '',
        post_code: ''
      },
      Process_form: {
        research_progress: ''
      },
      achievement_form: {
        id: '',
        achievement_name: '',
        achievement_author: '',
        achievement_type: '',
        achievement_publish: '',
        achievement_publish_time: '',
        achievement_number: '',
        achievement: ''
      },
      plan_form: {
        exfund_id: '',
        funds: '',
        book_fee: '',
        data_fee: '',
        travel_fee: '',
        meeting_fee: '',
        international_fee: '',
        equipment_fee: '',
        labour_fee: '',
        print_fee: '',
        administration_fee: '',
        other_fee: '',
        all_fee: '',
        surplus: '',
        unfund_id: '',
        book_fee_budget: '',
        data_fee_budget: '',
        travel_fee_budget: '',
        meeting_fee_budget: '',
        international_fee_budget: '',
        equipment_fee_budget: '',
        labour_fee_budget: '',
        print_fee_budget: '',
        administration_fee_budget: '',
        other_fee_budget: '',
        all_fee_budget: '',
        next_plan: '',
        funding_gap: ''
      },
      tableData: [],
      list: [],
      message: {
        form: '',
        Process_form: '',
        achievement_form: '',
        plan_form: '',
        delete: ''
      },
      status: 1,
      tips: {
        achievement_nameTips: '【项目名称】',
        achievement_authorTips: '【作者】',
        achievement_typeTips: '【成果形式】',
        achievement_publishTips: '【出版社】',
        achievement_numberTips: '【字数】',
        achievement_publish_timeTips: '【发表或出版时间】',
        achievementTips: '【获奖或转摘引用情况】',
        research_progressTips: '【研究进展情况不能为空】',
        fundsTips: '【本项目首次资助经费金额】',
        book_fee_budgetTips: '【资料费预算】',
        book_feeTips: '【资料费支出】',
        data_fee_budgetTips: '【数据采集费预算】',
        data_feeTips: '【数据采集费支出】',
        meeting_fee_budgetTips: '【会议费预算】',
        meeting_feeTips: '【会议费支出】',
        international_fee_budgetTips: '【国际合作交流费预算】',
        international_feeTips: '【国际合作交流费支出】',
        equipment_feeTips: '【设备费支出】',
        equipment_fee_budgetTips: '【设备费预算】',
        consulting_feeTips: '【专家咨询费支出】',
        consulting_fee_budgetTips: '【专家咨询费预算】',
        labour_feeTips: '【劳务费支出】',
        labour_fee_budgetTips: '【劳务费预算】',
        print_feeTips: '【印刷费支出】',
        print_fee_budgetTips: '【印刷费预算】',
        administration_feeTips: '【管理费支出】',
        administration_fee_budgetTips: '【管理费预算】',
        other_feeTips: '【其他支出】',
        other_fee_budgetTips: '【其他费用预算】',
        all_fee_budgetTips: '【合计预算】',
        all_feeTips: '【合计支出】',
        surplusTips: '【结余】',
        travel_feeTips: '【支出差旅费】',
        travel_fee_budgetTips: '【差旅费预算】',
        next_planTips: '【下一步研究计划】'
      }
    }
  },
  methods: {
    goback() {
      router.push({
        name: 'middetailpro',
        params: {
          id: this.$route.params.subId,
          midData: this.$route.params.midData,
          saveData: this.$route.params.saveData
        }
      })
    },
    showedit() {
      this.dialogVisible = true
      this.achievement_form = {}
    },
    down() {
      window.open(
        'http://localhost/cultivate/php/uploads/html/downmidcheckinfo.html'
      )
    },
    handleClick(row) {
      console.log(row)
      this.dialogVisible = true
      // var index = this.tableData.indexOf(row)
      // if (index !== -1) {
      //   this.tableData.splice(index, 1)
      // }
      this.achievement_form = row
    },
    handleDelete(row) {
      var index = this.tableData.indexOf(row)
      if (index !== -1) {
        this.tableData.splice(index, 1)
      }
      this.list.push(row.id)
      // console.log(this.list)
      this.message.delete = this.list
      //    console.log(this.message.delete);
    },
    submitform() {
      this.plan_form.funds = this.funds
      this.plan_form.next_plan = this.next_plan
      this.plan_form.funding_gap = this.funding_gap
      var checkResult1 = this.checkList(this.Process_form, [
        {
          name: 'research_progress',
          reg: ['notnull']
        }
      ])
      console.log(checkResult)
      if (_g.j2s(checkResult1) === '{}') {
        var checkResult2 = this.checkList(this.plan_form, [
          {
            name: 'surplus',
            reg: ['notnull']
          },
          {
            name: 'print_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'print_fee',
            reg: ['notnull']
          },
          {
            name: 'other_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'other_fee',
            reg: ['notnull']
          },
          {
            name: 'next_plan',
            reg: ['notnull']
          },
          {
            name: 'meeting_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'meeting_fee',
            reg: ['notnull']
          },
          {
            name: 'labour_fee',
            reg: ['notnull']
          },
          {
            name: 'labour_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'international_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'international_fee',
            reg: ['notnull']
          },
          {
            name: 'funds',
            reg: ['notnull']
          },
          {
            name: 'equipment_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'equipment_fee',
            reg: ['notnull']
          },
          {
            name: 'data_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'travel_fee',
            reg: ['notnull']
          },
          {
            name: 'travel_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'data_fee',
            reg: ['notnull']
          },
          {
            name: 'consulting_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'consulting_fee',
            reg: ['notnull']
          },
          {
            name: 'book_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'book_fee',
            reg: ['notnull']
          },
          {
            name: 'all_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'all_fee',
            reg: ['notnull']
          },
          {
            name: 'administration_fee_budget',
            reg: ['notnull']
          },
          {
            name: 'administration_fee',
            reg: ['notnull']
          }
        ])
        if (_g.j2s(checkResult2) === '{}') {
          var checkResult3 = this.checkList(this.form, [
            {
              name: 'project_mid_id',
              reg: ['notnull']
            },
            {
              name: 'pro_no',
              reg: ['notnull']
            },
            {
              name: 'finish_time',
              reg: ['notnull']
            },
            {
              name: 'title',
              reg: ['notnull']
            },
            {
              name: 'email',
              reg: ['notnull']
            },
            {
              name: 'name',
              reg: ['notnull']
            },
            {
              name: 'office',
              reg: ['notnull']
            },
            {
              name: 'phone',
              reg: ['notnull']
            },
            {
              name: 'post_code',
              reg: ['notnull']
            },
            {
              name: 'postal_address',
              reg: ['notnull']
            },
            {
              name: 'unit',
              reg: ['notnull']
            },
            {
              name: 'filling_date',
              reg: ['notnull']
            }
          ])
          // console.log(checkResult)
          if (_g.j2s(checkResult3) === '{}') {
            console.log(checkResult)
            // console.log(this.plan_form.funds)
            this.list = []
            // console.log(this.form)
            this.list.push(this.form)
            this.message.form = this.list
            this.list = []
            this.list.push(this.Process_form)
            this.message.Process_form = this.list
            this.message.achievement_form = this.tableData
            this.list = []
            this.list.push(this.plan_form)
            this.message.plan_form = this.list
            this.list = []
            console.log(this.message)
            let data = this.message
            this.apiPost('admin/Report/MidWrite', data).then(res => {
              this.handelResponse(res, data => {
                _g.toastMsg('success', res.data)
              })
            })
          } else {
            for (const key in checkResult) {
              _g.toastMsg('error', this.tips[key] + checkResult[key])
              break
            }
          }
        } else {
          for (const key in checkResult) {
            _g.toastMsg('error', this.tips[key] + checkResult[key])
            break
          }
        }
      } else {
        for (const key in checkResult) {
          _g.toastMsg('error', this.tips[key] + checkResult[key])
          break
        }
      }
    },
    // 将研究成果表单放在tableData
    submitachievement_form(achievement_form) {
      console.log(11)
      var checkResult = this.checkList(this.achievement_form, [
        {
          name: 'achievement',
          reg: ['notnull']
        },
        {
          name: 'achievement_type',
          reg: ['notnull']
        },
        {
          name: 'achievement_author',
          reg: ['notnull']
        },
        {
          name: 'achievement_name',
          reg: ['notnull']
        },
        {
          name: 'achievement_number',
          reg: ['notnull']
        },
        {
          name: 'achievement_publish',
          reg: ['notnull']
        },
        {
          name: 'achievement_publish_time',
          reg: ['notnull']
        }
      ])
      console.log(checkResult)
      if (_g.j2s(checkResult) === '{}') {
        // console.log(this.achievement_form)
        this.tableData.push(this.achievement_form)
        // console.log(this.tableData);
        this.message.achievement_form = this.tableData
        // console.log(this.message)
        this.dialogVisible = false
        this.achievement_form = {}
      } else {
        for (const key in checkResult) {
          _g.toastMsg('error', this.tips[key] + checkResult[key])
          break
        }
      }
    },
    getData() {
      let data = {
        subproject_id: this.$route.params.id
        // subproject_id: 9
      }
      this.apiPost('admin/Report/MidList', data).then(res => {
        this.handelResponse(res, data => {
          console.log(res.data)
          this.form = res.data.train[0]
          if (
            data.project_mid.length > 0 &&
            res.data.project_mid[0].status == 2
          ) {
            // 显示已经填写的数据
            // console.log(res.data)
            this.status = 2
            // this.form = res.data.train[0]
            this.tableData = res.data.achievementrain
            this.form.project_mid_id = res.data.project_mid[0].id
            this.plan_form = res.data.exfund[0]
            this.funds = res.data.project_mid[0].funds
            this.next_plan = res.data.project_mid[0].next_plan
            this.funding_gap = res.data.project_mid[0].funding_gap

            this.Process_form.research_progress =
              res.data.project_mid[0].research_progress
            // console.log(this.achievement_form)
            for (var p in this.message) {
              if (p == 'form') {
                this.list.push(this.form)
                this.message.form = this.list
                this.list = []
              } else if (p == 'Process_form') {
                this.list.push(this.Process_form)
                this.message.Process_form = this.list
                this.list = []
              } else if (p == 'achievement_form') {
                this.message.achievement_form = this.tableData
              } else {
                this.list.push(this.plan_form)
                this.message.plan_form = this.list
                this.list = []
              }
            }
            // console.log(this.message)
          }
        })
      })
    }
  },
  created() {
    _g.closeGlobalLoading()
    this.getData()
  },
  mixins: [http]
}
</script>
<style scoped>
.header {
  margin-bottom: 10px;
  background-image: linear-gradient(#e9f0e9, white);
}
.welcome {
  padding-left: 10px;
}
.header {
  margin-bottom: 10px;
  background-image: linear-gradient(#e9f0e9, white);
}
.formall {
  background: #fff;
}
.form_demo {
  padding: 0px 155px;
}
.form_demo_input {
  background-color: #f5f7fa;
  border-color: #e4e7ed;
  color: #c0c4cc;
  cursor: not-allowed;
  widdth: 230;
  width: 230px;
}
.title {
  border-top: 1px dashed rgb(210, 214, 222);
  margin: 0px auto 12px auto;
  padding: 16px;
}
.dialog_demo {
  width: 320px;
}
.form_item {
  margin-left: 100px;
  width: 409px;
}
.line {
  border-bottom: 1px solid rgb(216, 220, 223);
  width: 882px;
  margin-left: 81px;
  margin-bottom: 10px;
}
.button_demo {
  height: 60px;
  margin: 30px;
  text-align: center;
}
.table_demo {
  margin: 10px;
}
</style>
